/**
  * @param {Array} originArr 原数组
  * @param {String} label 显示的字段
  * @param {String} value 提交的内容
  * @returns 转换为下拉框需要数据
  */
export const changeArrField = (originArr, label, value) => {
  if (!originArr || !originArr.length) {
    return [];
  }

  return originArr.map((item) => {
    return {
      label: item[label],
      value: item[value],
      type: "option"
    };
  });
};

/**
 *
 * **/
// 补齐数组
export default (arr, count) => {
  const addNum = arr.length % count;
  const newArr = arr;
  for (let i = 0; i < (count - addNum); i++) {
    newArr.push({});
  }
  return newArr;
};
